package com.zzxx.mapper;

import com.zzxx.entity.ManagerQr;
import com.zzxx.entity.ManagerQrExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface ManagerQrMapper {
    @SelectProvider(type=ManagerQrSqlProvider.class, method="countByExample")
    long countByExample(ManagerQrExample example);

    @DeleteProvider(type=ManagerQrSqlProvider.class, method="deleteByExample")
    int deleteByExample(ManagerQrExample example);

    @Delete({
        "delete from managerqr",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    @Insert({
        "insert into managerqr (id, managerId, ",
        "type, objId, time, ",
        "objName)",
        "values (#{id,jdbcType=VARCHAR}, #{managerid,jdbcType=VARCHAR}, ",
        "#{type,jdbcType=INTEGER}, #{objid,jdbcType=VARCHAR}, #{time,jdbcType=TIMESTAMP}, ",
        "#{objname,jdbcType=VARCHAR})"
    })
    int insert(ManagerQr row);

    @InsertProvider(type=ManagerQrSqlProvider.class, method="insertSelective")
    int insertSelective(ManagerQr row);

    @SelectProvider(type=ManagerQrSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="managerId", property="managerid", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="objId", property="objid", jdbcType=JdbcType.VARCHAR),
        @Result(column="time", property="time", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="objName", property="objname", jdbcType=JdbcType.VARCHAR)
    })
    List<ManagerQr> selectByExample(ManagerQrExample example);

    @Select({
        "select",
        "id, managerId, type, objId, time, objName",
        "from managerqr",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="managerId", property="managerid", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="objId", property="objid", jdbcType=JdbcType.VARCHAR),
        @Result(column="time", property="time", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="objName", property="objname", jdbcType=JdbcType.VARCHAR)
    })
    ManagerQr selectByPrimaryKey(String id);

    @UpdateProvider(type=ManagerQrSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") ManagerQr row, @Param("example") ManagerQrExample example);

    @UpdateProvider(type=ManagerQrSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") ManagerQr row, @Param("example") ManagerQrExample example);

    @UpdateProvider(type=ManagerQrSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ManagerQr row);

    @Update({
        "update managerqr",
        "set managerId = #{managerid,jdbcType=VARCHAR},",
          "type = #{type,jdbcType=INTEGER},",
          "objId = #{objid,jdbcType=VARCHAR},",
          "time = #{time,jdbcType=TIMESTAMP},",
          "objName = #{objname,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(ManagerQr row);
}